<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      body {
        background-color: rgba(0, 0, 0, 0); 
      }
      * {
        margin: 0;
        padding: 0;
      } 
      .box {
        width: 500px;
        height: 300px;
        border: 3px solid #ff9900;
        margin: 100px auto;
        display: none;
        z-index: 100;
      }
      .t {
        background-color: #ffcc00;
        width: 100%;
        height: 10%;
      }
      .b {
        background-color: #00ffff;
        width: 100%;
        height: 90%;
      }
      p {
        float: right;
        background-color: #fff;
        margin-right: 20px;
        width: 20px;
        height: 20px;
        cursor: pointer;
      }
    </style>
  </head>
  <body>
    <button onclick="jump()">弹出层</button>
    <div class="show">
      <div class="shodow">
        <div class="box" id="w">
          <div class="t">
            <p id="p" onclick="out()">x</p>
          </div>
          <div class="b"></div>
        </div>
      </div>
    </div>
  </body>
</html>
<script>
  var sho = document.getElementsByTagName("body")[0];
  var w = document.getElementById("w");
  var p = document.getElementById("p");
  console.log(sho);
  function jump() {
    sho.style.cssText="background-color: rgba(0, 0, 0, 0.539);";
    w.style.display = "block";
  }
  function out() {
    sho.style.cssText="background-color: rgba(0, 0, 0, 0);";
    w.style.display = "none";
  }
</script>
